import React, { Component } from 'react'
export default class componentName extends Component {
  handleSubmit = (event)=>{
    event.preventDefault();
    let username = this.refs.username.value;
    localStorage.setItem('username',username);
  }
  render() {
    return (
      <form onSubmit={this.handleSubmit}>
        <div className="form-group">
          <label >用户名</label>
          <input ref="username" className="form-control" name="username" id="username"/>
        </div>
        <div className="form-group">
          <input type="submit" className="btn btn-primary"/>
        </div>
    </form>
    )
  }
}

